<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	$(function() {
		parent.$.messager.progress('close');
		$('#form').form({
			url : '/propertyEmployee/add',
			onSubmit : function() {
				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				try{
					parent.$.messager.progress('close');
					result = $.parseJSON(result);
					if (result.success) {
						parent.$.modalDialog.openner_dataGrid.datagrid('reload');
						parent.$.modalDialog.handler.dialog('close');
					} else {
						$.messager.alert("提示",result.msg, 'info');
					}
				} catch(e){
					$.messager.alert("提示",result, 'info');
				}
			}
		});
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
		<form id="form" method="post">
			<input name="id" type="hidden" class="span2" value="" readonly="readonly"/>
			<table class="table table-hover table-condensed">
				<tr>
					<th>名字</th>
					<td><input name="name" type="text" placeholder="名字"  data-options="required:true,validType:'length[2,10]'" class="easyui-validatebox span2" value=""></td>
					<th>选择公司</th>
					<td>
								<select name="companyId" id="companyId" class="easyui-combobox"  data-options="editable:false,required:true,width:150,icons:[{
											iconCls:'icon-clear',
											handler: function(e){
												$(e.data.target).combobox('clear');
											}
										}]" >
									<c:forEach items="${companey }" var="r">
												<option value="${r.value }" >${r.text }</option>
									</c:forEach>
							</select>
					</td>
				</tr>
				<tr>
					<th>性别</th>
					<td>
							<select name="sex" id="sexId"  class="easyui-combobox" data-options="editable:false,required:true,panelHeight:'auto',width:150,icons:[{
											iconCls:'icon-clear',
											handler: function(e){
												$(e.data.target).combobox('clear');
											}
										}]" >
									<c:forEach items="${sexType }" var="sex">
												<option value="${sex.code }" >${sex.name }</option>
									</c:forEach>
							</select>
					</td>
					<th>年龄</th>
					<td><input name="age" type="text" placeholder="年龄"  data-options="validType:'isNumber'" class="easyui-validatebox span2" value=""></td>
				</tr>
				<tr>
					<th>证件类型</th>
					<td>
						<select name="certType"  class="easyui-combobox" id="certTypeId"  data-options="editable:false,panelHeight:'auto',required:true,width:150,icons:[{
											iconCls:'icon-clear',
											handler: function(e){
												$(e.data.target).combobox('clear');
											}
										}]" >
									<c:forEach items="${credentialType }" var="cred">
												<option value="${cred.type }" >${cred.name }</option>
									</c:forEach>
							</select>
					</td>
					<th>证件号码</th>
					<td><input name="certNum" type="text" placeholder="证件号码"  data-options="" class="span2" value=""></td>
				</tr>
				<tr>
				<tr>
					<th>员工岗位</th>
					<td><input name="post" type="text" placeholder="员工股岗位"  data-options="" class="easyui-validatebox span2" value=""></td>
					<td>手机号码</td>
					<td >
						<input name="mobile"  type="text" placeholder="手机号码" class="easyui-validatebox span2" data-options="validType:'isPhoneNumber'" value="" />
					</td>
				</tr>
				<tr>
					<th>邮箱地址</th>
					<td colspan="3"><input name="email" type="text" placeholder="邮箱地址"  style="width:393px" data-options="validType:'email'" class="easyui-validatebox span2" value=""></td>
				</tr>
				<tr>
					<td>地址</td>
					<td colspan="3">
						<input name="address"  type="text" placeholder="居住地址"  style="width:393px" class="easyui-validatebox" data-options="validType:'maxLength[400]'" value="" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>